<form action="{:url()}" method="post" class="form_single">
  <input name="tjuser"  type="hidden" value="{$info['leader_username']}">
    <div class="box">
      <div class="box-body">
        <div class="row">
          <div class="col-md-6">
            <div class="form-group">
              <label>用户名</label>
              <span>（用户名会用作登录名）</span>
              <input class="form-control" name="username" placeholder="请输入用户名" value="{$info['username']}" type="text">
            </div>
          </div>
		  <div class="col-md-6">
            <div class="form-group">
              <label>姓名</label>
              <span>（用户姓名或昵称）</span>
              <input class="form-control" name="name" placeholder="请输入姓名"  value="{$info['name']}" type="text">
            </div>
          </div>
          <div class="col-md-6">
            <div class="form-group">
              <label>分享人</label>
              （<span style="color:green" id="fxr">{$info['tjname']}</span>）
              <input class="form-control" name="tjusername" placeholder="请输入分享人" type="text" value="{$info['leader_username']}">
            </div>
          </div>
		<div class="col-md-6">
            <div class="form-group">
              <label>手机号</label>
              <span>（用于登录或找回密码）</span>
              <input class="form-control" name="phone" placeholder="请输入手机号" type="text" value="{$info['phone']}" maxlength="11">
            </div>
          </div>
                 
		 <div class="col-md-6">
			 <div class="form-group">
			 <label>会员类型</label>
			 <span>（若选择报单中心就可以报单）</span>
			 <div>
				<label class="margin-r-5"><input type="radio" name="is_service" {$info['is_service'] == 0 ? 'checked' : ''} data="{$info['is_service']}" value="0"> 普通用户</label>
			 <label><input type="radio"  name="is_service" {$info['is_service']==1 ? 'checked' : ''} value="1"> 代理商</label>
			 <!-- <label><input type="radio"  name="is_service" {$info['is_service']==2 ? 'checked' : ''} value="2"> 店主</label> -->
			 </div>
			 </div>
		 </div>
          <div class="col-md-6">
            <div class="form-group">
              <label>代理地区</label>
              <span class=""></span><br/>
              <select name="county" id="county" class="form-control" style="width:30%;float:right;">
                <option value="">区县</option>
                {notempty name="clist"}
                {volist name='alist' id='vo'}
                <option value="{$vo['name']}" {notempty name="info['county']"}{if condition="$info['county'] eq $vo['name']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>
                {/volist}
                {/notempty}
              </select>
              <select name="city" id="city" class="form-control" style="width:30%;float:right;">
                <option value="">市区</option>
                {notempty name="clist"}
                {volist name='clist' id='vo'}
                <option value="{$vo['name']}" {notempty name="info['city']"}{if condition="$info['city'] eq $vo['name']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>
                {/volist}
                {/notempty}
              </select>
              <select name="province" id="province" class="form-control" style="width:30%;float:right;">
                <option value="">省份</option>
                {volist name='plist' id='vo'}
                <option value="{$vo['name']}" {notempty name="info['province']"}{if condition="$info['province'] eq $vo['name']"} selected="selected" {/if}{/notempty} >{$vo['name']}</option>
                {/volist}
              </select>
            </div>
          </div>
        </div>
      </div>
      <div class="box-footer">
        
        <input type="hidden" name="id" value="{$info['id']|default='0'}"/>
          
        {include file="layout/edit_btn_group"/}
        
      </div>
      <script>
        $(function(){
            $("input[name='tjusername']").blur(function(){
                var username=$(this).val();
                var user_id={$info.id};
              $.post("{:url('user/checkUsername')}",{username:username,user_id:user_id},function(data){
                if(data.code == 0){
                  layer.alert('分享人变更后不可逆，请慎重修改');
                  $("#fxr").html(data.msg);
                }else{
                  layer.msg(data.msg);
                   $("#fxr").html('无');
                }
              },'json')
            })
        })
        $("#province").change(function(){
          var id=$(this).val();
          $.post("{:url('goods/user_province')}",{id:id},function( data ){
            if(data.code==0){
              $("#city").html(data.html);
            }else{
              layer.msg(data.msg);
            }
          },'json');
        });
        $("#city").change(function(){
          var id=$(this).val();
          $.post("{:url('goods/user_city')}",{id:id},function( data ){
            if(data!=""){
              $("#county").html(data);
            }else{
              alert("未知错误！");
            }
          });
        });
      </script>
    </div>
</form>
